//
//  PersonalDataModel.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/7/27.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class PersonalDataModel: NSObject {
    var is_authentic = "-999"
    var can_apply_merchant = "-999"
    var order_notakes_count = "-999"
    var nickname = "-999"
    var set_paypwd_url = "-999"
    var favorites_goods = "-999"
    var modify_pwd_url = "-999"
    var order_nosend_count = "-999"
    var share_data : ShareContentModel?
    var balance = "-999"
    var return_count = "-999"
    var order_noeval_count = "-999"
    var upload_avatar_url = "-999"
    var bean = "-999"
    var aboutus_url = "-999"
    var is_merchant = "-999"
    var order_nopay_count = "-999"
    var gold = "-999"
    var paypwd_state = "-999"
    var foot_prints = "-999"
    var merchant_url = "-999"
    var avator = "-999"
    var user_name = "-999"

    init(dic : [String : AnyObject]) {
        super.init()
        
        setValuesForKeys(dic)
        
    }
    
    
    override func  setValue(_ value: Any?, forKey key: String) {
        
        if key == "share_data" {
            
            if let temp = value as? [String : AnyObject]{
                
                share_data = ShareContentModel(dic:temp )
                
            }
            
        } else {
            
            
            super.setValue(value, forKey: key)
        }
        
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
        
    }
    
    
    //在swift中想要打印对象要以下重写属性
    override var description: String{
        let keys = ["is_authentic","can_apply_merchant","order_notakes_count","nickname","set_paypwd_url","favorites_goods","modify_pwd_url","order_nosend_count","share_data","balance","return_count","order_noeval_count","upload_avatar_url","bean","aboutus_url","is_merchant","order_nopay_count","gold","paypwd_state","foot_prints","merchant_url","avator","user_name"]
        let dic = dictionaryWithValues(forKeys: keys)
        return "\(dic)"
    }



}
